package cn.powerone.scm.service.impl;

import java.util.List;
import cn.powerone.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.powerone.scm.mapper.ScmStatsCustomerYearlyMapper;
import cn.powerone.scm.domain.ScmStatsCustomerYearly;
import cn.powerone.scm.service.IScmStatsCustomerYearlyService;

/**
 * 客户年度统计信息-总Service业务层处理
 * 
 * @author PowerOne
 * @date 2025-09-09
 */
@Service
public class ScmStatsCustomerYearlyServiceImpl implements IScmStatsCustomerYearlyService 
{
    @Autowired
    private ScmStatsCustomerYearlyMapper scmStatsCustomerYearlyMapper;

    /**
     * 查询客户年度统计信息-总
     * 
     * @param id 客户年度统计信息-总主键
     * @return 客户年度统计信息-总
     */
    @Override
    public ScmStatsCustomerYearly selectScmStatsCustomerYearlyById(Long id)
    {
        return scmStatsCustomerYearlyMapper.selectScmStatsCustomerYearlyById(id);
    }

    /**
     * 查询客户年度统计信息-总列表
     * 
     * @param scmStatsCustomerYearly 客户年度统计信息-总
     * @return 客户年度统计信息-总
     */
    @Override
    public List<ScmStatsCustomerYearly> selectScmStatsCustomerYearlyList(ScmStatsCustomerYearly scmStatsCustomerYearly)
    {
        return scmStatsCustomerYearlyMapper.selectScmStatsCustomerYearlyList(scmStatsCustomerYearly);
    }

    /**
     * 新增客户年度统计信息-总
     * 
     * @param scmStatsCustomerYearly 客户年度统计信息-总
     * @return 结果
     */
    @Override
    public int insertScmStatsCustomerYearly(ScmStatsCustomerYearly scmStatsCustomerYearly)
    {
        scmStatsCustomerYearly.setCreateTime(DateUtils.getNowDate());
        return scmStatsCustomerYearlyMapper.insertScmStatsCustomerYearly(scmStatsCustomerYearly);
    }

    /**
     * 修改客户年度统计信息-总
     * 
     * @param scmStatsCustomerYearly 客户年度统计信息-总
     * @return 结果
     */
    @Override
    public int updateScmStatsCustomerYearly(ScmStatsCustomerYearly scmStatsCustomerYearly)
    {
        scmStatsCustomerYearly.setUpdateTime(DateUtils.getNowDate());
        return scmStatsCustomerYearlyMapper.updateScmStatsCustomerYearly(scmStatsCustomerYearly);
    }

    /**
     * 批量删除客户年度统计信息-总
     * 
     * @param ids 需要删除的客户年度统计信息-总主键
     * @return 结果
     */
    @Override
    public int deleteScmStatsCustomerYearlyByIds(Long[] ids)
    {
        return scmStatsCustomerYearlyMapper.deleteScmStatsCustomerYearlyByIds(ids);
    }

    /**
     * 删除客户年度统计信息-总信息
     * 
     * @param id 客户年度统计信息-总主键
     * @return 结果
     */
    @Override
    public int deleteScmStatsCustomerYearlyById(Long id)
    {
        return scmStatsCustomerYearlyMapper.deleteScmStatsCustomerYearlyById(id);
    }
}
